VPATH = src

cpp = g++
executable = khazaddum
objects = main.o hero.o level.o person.o draw.o
cppflags = -Wall -g -Isrc

ifeq ($(OS),Windows_NT)
	executable = khazaddum.exe
 	cppflags += -IP:\lib\libtcod-1.5.0\include
	libs += -LP:\lib\libtcod-1.5.0\lib -ltcod-mingw-debug
else
	cppflags += -Ilibtcod-1.5.0/include
	libs += -ltcod -ltcodxx
endif


all: $(executable)


#
# Basic rules
#
$(executable) : $(objects)
	$(cpp) $^ -o $(executable) $(libs)


.cpp.o :
	$(cpp) $(cppflags) -c $<


#
# Clean
#
.PHONY : clean
clean :
ifeq ($(OS),Windows_NT)
	-del $(objects) $(executable)
else
	-rm $(objects) $(executable)
endif
